<?php
/**
 * oscshop2 B2C电子商务系统
 *
 * ==========================================================================
 * @link      http://www.oscshop.cn/
 * @copyright Copyright (c) 2015-2017 oscshop.cn. 
 * @license   http://www.oscshop.cn/license.html License
 * ==========================================================================
 *
 * @author    李梓钿
 *
 * 用户注册验证
 */ 
namespace osc\mobile\validate;
use think\Validate;
class Idcard extends Validate
{

/*
    $rule = [
        ['username','number|require|max:13','用户手机号码必填|必须是数字'],
        ['sharemobile','number|require|max:13','推荐人手机号码必填|必须是数字'],
        ['nikename','require|length:6,30|chsDash','用户昵称必填|长度6-30|必须汉字、字母、数字和下划线_'],
        ['password','require|length:6,32','密码必填|长度6-32'],
        ['2password','require|length:6,32','二级密码必填|长度6-32']
    ];

*/

    protected $rule = [
        'idcard'    => ['/(^\d(15)$)|((^\d{18}$))|(^\d{17}(\d|X|x)$)/'],
        'idcardname'     => ['/^1[34578]\d{9}$/'],

    ];
    protected $message = [
        'idcard'    => '非法身份证号，请仔细核实',
        'idcardname'     => '手机号格式不正确',
    ];
   
    protected $scene = [
        'update2passwd'=>['password','code','2password', '2pwd2'],
    ];
}
?>